import urllib.request as req
url = "https://www.baidu.com/"
file = req.urlopen(url)
headers = file.headers
print("headers=%s"%headers)

print(file)